home *** CD-ROM | disk | FTP | other *** search
- ' This file contains the global objects used by all application pages and McDash.htm
- ' This file can only be included in McDash.htm...
-
- Option Explicit
-
- Dim gObjDashboard
- Dim gobjExternal, gDBobjReg
- Dim gDBobjOS
- Dim gDBobjFS
- Dim gDBobjShell
-
- Function InitializeGlobals()
- '{
- Dim bInitSuccess
-
- Set gobjExternal = nothing
- Set gDBobjReg = nothing
- Set gObjDashboard = nothing
- Set gDBobjOS = nothing
- Set gDBobjFS = nothing
- Set gDBobjShell = nothing
-
- bInitSuccess = TRUE
- Dim bSetExternalObject
- bSetExternalObject = SetExternalObject( gobjExternal )
-
- If FALSE = bSetExternalObject Then
- bInitSuccess = FALSE
- End If
-
- ' Create Registry object...
- Set gDBobjReg = gobjExternal.CreateObject( CLSID_CoMCRegistry, CLSID_LIC, true )
- If gDBobjReg is nothing Then
- bInitSuccess = FALSE
- End If
-
- gDBobjReg.obfuscate = TRUE
-
- ' Create OS object...
- Set gDBobjOS = gobjExternal.CreateObject( CLSID_CoMCOS, CLSID_LIC, true )
- If gDBobjOS is nothing Then
- bInitSuccess = FALSE
- End If
-
- ' Create FS object...
- Set gDBobjFS = gobjExternal.CreateObject( CLSID_CoMCFileSystem, CLSID_LIC, true )
- If gDBobjFS is nothing Then
- bInitSuccess = FALSE
- End If
-
- ' Create SHELL object...
- Set gDBobjShell = gobjExternal.CreateObject( CLSID_CoMCShell, CLSID_LIC, true )
- If gDBobjShell is nothing Then
- bInitSuccess = FALSE
- End If
-
- InitializeGlobals = bInitSuccess
- '}
- End Function
-
-
- '/////////////////////////////////////////////////////////////////////////////
- '// Sets the window.external object to "objExternal".
- '// It also makes sure that window.external is the external object exposed
- '// by MgHtml.
- '// Returns : True, if objExternal is set and valid.
- '// Else objExternal = nothing and function returns False.
- '/////////////////////////////////////////////////////////////////////////////
-
- Function SetExternalObject( ByRef objExternal )
- '{
- Dim nLastError
-
- On Error Resume Next ' This is local for this function.
-
- Set objExternal = nothing
- SetExternalObject = False
- If IsObject( window.external ) And not window.external is nothing Then
- '{
- Set objExternal = window.external
- Err.Clear
- nLastError = Err.Number
- objExternal.ReturnValue = CLng(-1)
- If Err.Number <> nLastError Then
- '{
- Set objExternal = nothing
- Exit Function
- '}
- End If
- SetExternalObject = True
- '}
- End If
- '}
- End Function
-
-
-